import Layout from '@/layout'

const routes = [
  {
    path: '/',
    component: Layout,
    meta: { title: '首页', icon: 'el-icon-s-home' },
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home'),
        meta: {
          title: '首页',
          icon: 'el-icon-s-home'
        }
      }
    ]
  },
  {
    path: '/job',
    component: Layout,
    meta: {
      title: '任务管理',
      icon: 'el-icon-s-claim',
      group: {
        校对任务: ['CheckUnclaimed', 'CheckClaimed', 'CheckFinished'],
        审核任务: ['ReviewerUnclaimed', 'ReviewerClaimed', 'ReviewerFinished']
      }
    },
    children: [
      {
        path: 'check/claimed',
        name: 'CheckClaimed',
        component: () => import('@/views/test'),
        meta: {
          title: '已领取'
        }
      },
      {
        path: 'check/unclaimed',
        name: 'CheckUnclaimed',
        component: () => import('@/views/test'),
        meta: {
          title: '未领取'
        }
      },
      {
        path: 'check/finished',
        name: 'CheckFinished',
        component: () => import('@/views/test'),
        meta: {
          title: '已完成'
        }
      },
      {
        path: 'review/claimed',
        name: 'ReviewerClaimed',
        component: () => import('@/views/test'),
        meta: {
          title: '已领取'
        }
      },
      {
        path: 'review/unclaimed',
        name: 'ReviewerUnclaimed',
        component: () => import('@/views/test'),
        meta: {
          title: '未领取'
        }
      },
      {
        path: 'review/finished',
        name: 'ReviewerFinished',
        component: () => import('@/views/test'),
        meta: {
          title: '已完成'
        }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    meta: {
      title: '权限管理',
      icon: 'el-icon-edit-outline'
    },
    children: [
      {
        path: '',
        name: 'User',
        component: () => import('@/views/user'),
        meta: {
          title: '用户管理',
          icon: 'el-icon-user',
          policy: 'AbpIdentity.Users'
        }
      },
      {
        path: 'role',
        name: 'Role',
        component: () => import('@/views/role'),
        meta: {
          title: '角色管理',
          icon: 'el-icon-lock',
          policy: 'AbpIdentity.Roles'
        }
      }
    ]
  },
  {
    path: '/system',
    component: Layout,
    meta: {
      title: '系统管理',
      icon: 'el-icon-setting'
    },
    children: [
      {
        path: 'audit',
        name: 'AuditLog',
        component: () => import('@/views/system/audit'),
        meta: {
          title: '审计日志',
          icon: 'el-icon-date'
        }
      },
      {
        path: 'task',
        name: 'taskLog',
        component: () => import('@/views/test'),
        meta: {
          title: '任务日志',
          icon: 'el-icon-document'
        }
      }
    ]
  }
]

export default routes
